/*
 * user_task.h
 *
 *  Created on: 2020年10月28日
 *      Author: Tao
 */

#ifndef SOURCE_USER_USER_TASK_H_
#define SOURCE_USER_USER_TASK_H_

#include "user_task.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "event_groups.h"

#define TASK_BIT_1    (0x01 << 0)
#define TASK_BIT_2    (0x01 << 1)
#define TASK_BIT_3    (0x01 << 2)
#define TASK_BIT_4    (0x01 << 3)
#define TASK_BIT_5    (0x01 << 4)
#define TASK_BIT_6    (0x01 << 5)
#define TASK_BIT_7    (0x01 << 6)
#define TASK_BIT_8    (0x01 << 7)

#define TASK_BIT_ALL    ( TASK_BIT_1 | TASK_BIT_2 | TASK_BIT_3)

//任务优先级
#define START_TASK_PRIO     1
//任务堆栈大小
#define START_STK_SIZE         100
//任务句柄
extern TaskHandle_t StartTask_Handler;

//任务优先级
#define LED0_TASK_PRIO        0
//任务堆栈大小
#define LED0_STK_SIZE            50
//任务句柄
extern TaskHandle_t LED0Task_Handler;


//任务优先级
#define MODBUS_POLL_TASK_PRIO      3
//任务堆栈大小
#define MODBUS_POLL_STK_SIZE          200
//任务句柄
extern TaskHandle_t ModbusPollTask_Handler;

#ifdef ADS1115
//任务优先级
#define ADS1115_DAQ_TASK_PRIO      2
//任务堆栈大小
#define ADS1115_DAQ_STK_SIZE         200
//任务句柄
extern TaskHandle_t ADS1115DaqTask_Handler;
#endif

//任务优先级
#define MCU_ADC_DAQ_TASK_PRIO      3
//任务堆栈大小
#define MCU_ADC_DAQ_STK_SIZE       1000
//任务句柄
extern TaskHandle_t McuAdcDaqTask_Handler;

//任务优先级
#define MBREFRESHTASK_TASK_PRIO      3
//任务堆栈大小
#define MBREFRESHTASK_STK_SIZE       200
//任务句柄
extern TaskHandle_t MBRefreshTask_Handler;

//任务优先级
#define CC1101CONFIGTASK_TASK_PRIO      10
//任务堆栈大小
#define CC1101CONFIGTASK_STK_SIZE       200
//任务句柄
extern TaskHandle_t CC1101Config_Handler;

//任务优先级
#define DHT11DAQ_TASK_PRIO					1
//任务堆栈大小
#define DHT11DAQ_TASK_STK_SIZE			200
//任务句柄
extern TaskHandle_t DHT11DaqTask_Handler;

//任务优先级
#define STORABLEDATASAVE_TASK_PRIO      0
//任务堆栈大小
#define STORABLEDATASAVE_TASK_STK_SIZE       200
//任务句柄
extern TaskHandle_t StorableDataSaveTask_Handler;


//任务优先级
#define LIMITSWITCHMONITOR_TASK_PRIO      5
//任务堆栈大小
#define LIMITSWITCHMONITOR_TASK_STK_SIZE       400
//任务句柄
extern TaskHandle_t LimitSwitchMonitorTask_Handler;

//任务优先级
#define IWDGTASK_TASK_PRIO      6
//任务堆栈大小
#define IWDGTASK_STK_SIZE       100
//任务句柄
extern TaskHandle_t IwdgTask_Handler;

void FreeRTOS_Exec();
void start_task(void *pvParameters);
//void Iwdg_task(void *pvParameters);
void led0_task(void *pvParameters);
//void ModbusPoll_task(void *pvParameters);

#ifdef ADS1115
void ADS1115Daq_task(void *pvParameters);
#endif

void McuAdcDaq_task(void *pvParameters);

//void  MBRefresh_task(void *pvParameters);
void WSN31Config_task(void *pvParameters);
//void DHT11Daq_task(void *pvParameters);
//
//void StorableDataSave_task(void *pvParameters);
//void LimitSwitchMonitor_task(void *pvParameters);

#endif /* SOURCE_USER_USER_TASK_H_ */
